package company.jingji;

import java.util.Scanner;

/**
 * @author briarbear
 * @blog https://briarbear.github.io
 * @date 2018-09-20 14:40
 */
public class J1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int m = scanner.nextInt();
            int n = scanner.nextInt();
            helper(m,n);
        }
    }

    public static void helper(int m,int n){
        int max,min,value = 1;
        if (m == n){
            System.out.println(m + " " + n);
            return ;
        }

        max = Math.max(m,n);
        min  = Math.min(m,n);
        for (int i = 2; i <=  min; i++) {
            if ((max % i == 0)&&(min % i == 0)){
                value = i;
            }
        }

        System.out.println(value + " " + min * max / value);
    }
}
